﻿<div data-ng-app="app">
    <div data-ng-controller="ngNavController">

        <nav class="navbar navbar-default" role="navigation">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="/">Graphactory</a>
                </div>
                <div class="navbar-left">
                    <ul class="nav navbar-nav">
                        <li data-ng-show="token"><a href="#/ngGraphList/">My Graphs</a></li>
                    </ul>
                </div>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <li data-ng-hide="token"><a href data-toggle="modal" data-target="#login-modal">Login / Register</a></li>
                        <li data-ng-show="token"><a href data-ng-click="logout()">Logout</a></li>
                    </ul>
                </div>
            </div>
        </nav>

        <div class="modal fade" id="login-modal">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h3 class="modal-title">Account Access</h3>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-xs-12" data-ng-show="errorMessage">
                                <p>{{errorMessage}}</p>
                            </div>
                            <div data-ng-hide="register" class="col-xs-12">
                                <h4>Login</h4>
                                <p>Just checking things out? Feel free to use these test login credentials</p>
                                <dl>
                                    <dt>username:</dt>
                                    <dd>user01</dd>
                                    <dt>password:</dt>
                                    <dd>pass01</dd>
                                </dl>
                                <form>
                                    <div class="form-group">
                                        <label>Username</label>
                                        <input ng-disabled="loggingIn" type="text" class="form-control" data-ng-model="user.username" placeholder="Username" />
                                    </div>
                                    <div class="form-group">
                                        <label>Password</label>
                                        <input ng-disabled="loggingIn" type="password" class="form-control" data-ng-model="user.password" placeholder="Password" />
                                    </div>
                                    <div class="form-group">

                                        <input ng-disabled="loggingIn" type="button" class="form-control btn btn-success" value="Login" data-ng-click="login()" />
                                        <input ng-disabled="loggingIn" type="button" class="form-control btn btn-warning" value="Cancel" data-dismiss="modal" />
                                    </div>
                                </form>
                                <hr />

                                <form>
                                    <input ng-disabled="loggingIn" class="btn btn-success form-control" value="I need to register" data-ng-click="register=!register" />
                                </form>
                            </div>
                            <div data-ng-show="register" class="col-xs-12">
                                <h4>Register</h4>
                                <form>
                                    <div class="form-group">
                                        <label>Email</label>
                                        <input ng-disabled="loggingIn" class="form-control" type="email" data-ng-model="regModel.Email" />
                                    </div>
                                    <div class="form-group">
                                        <label>Username</label>
                                        <input ng-disabled="loggingIn" class="form-control" type="text" data-ng-model="regModel.UserName" />
                                    </div>
                                    <div class="form-group">
                                        <label>Password</label>
                                        <input ng-disabled="loggingIn" class="form-control" type="password" data-ng-model="regModel.Password" />
                                    </div>
                                    <div class="form-group">
                                        <label>Confirm Password</label>
                                        <input ng-disabled="loggingIn" class="form-control" type="password" data-ng-model="regModel.ConfirmPassword" />
                                    </div>
                                    <div class="form-group">
                                        <input ng-disabled="loggingIn" type="button" class="btn btn-success form-control" value="Register" data-ng-click="registerUser()" />
                                        <input ng-disabled="loggingIn" type="button" class="btn btn-warning form-control" value="Cancel" data-dismiss="modal" />
                                    </div>
                                </form>
                                <hr />

                                <form>
                                    <input ng-disabled="loggingIn" class="btn btn-success form-control" value="I need to login" data-ng-click="register=!register" />
                                </form>

                            </div>
                            
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <div data-ng-view>
        </div>
    </div>
</div>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/angular-route.min.js"></script>

<script src="~/App_Web/Scripts/MrGraphie.js"></script>
<script src="~/App_Web/Scripts/MrGraphieTemplates.js"></script>
<script src="~/App_Web/Scripts/MrGraphieBundler.js"></script>

<script src="~/App_Web/Scripts/ngMain.js"></script>
<script src="~/App_Web/Scripts/ngRoutes.js"></script>
<script src="~/App_Web/Scripts/ngNavController.js"></script>
<script src="~/App_Web/Scripts/ngHomeController.js"></script>
<script src="~/App_Web/Scripts/ngGraphListController.js"></script>
